<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Flow-IPC: ipc::transport::Blob_stream_mq_base&lt; Persistent_mq_handle &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Flow-IPC<span id="projectnumber">&#160;2.0.0</span>
   </div>
   <div id="projectbrief">Flow-IPC project: Full implementation reference.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceipc.html">ipc</a></li><li class="navelem"><a class="el" href="namespaceipc_1_1transport.html">transport</a></li><li class="navelem"><a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__base.html">Blob_stream_mq_base</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classipc_1_1transport_1_1Blob__stream__mq__base-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">ipc::transport::Blob_stream_mq_base&lt; Persistent_mq_handle &gt; Class Template Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Base of <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__sender.html" title="Implements Blob_sender concept by using an adopted Persistent_mq_handle MQ handle to an MQ (message q...">Blob_stream_mq_sender</a> and <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__receiver.html" title="Implements Blob_receiver concept by using an adopted Persistent_mq_handle MQ handle to an MQ (message...">Blob_stream_mq_receiver</a> containing certain <code>static</code> facilities, particularly for post-abort persistent resource cleanup.  
 <a href="classipc_1_1transport_1_1Blob__stream__mq__base.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="blob__stream__mq_8hpp_source.html">blob_stream_mq.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for ipc::transport::Blob_stream_mq_base&lt; Persistent_mq_handle &gt;:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classipc_1_1transport_1_1Blob__stream__mq__base__inherit__graph.svg" width="440" height="275"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ac1230ff7e73783da730b8639c30511e2"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__base.html#ac1230ff7e73783da730b8639c30511e2">remove_persistent</a> (flow::log::Logger *logger_ptr, const <a class="el" href="namespaceipc_1_1transport.html#a33de1c256addb3964b839dc2dd407d24">Shared_name</a> &amp;name, <a class="el" href="namespaceipc.html#aa3192e586cc45d3e7c22463bf2760f89">Error_code</a> *err_code=0)</td></tr>
<tr class="memdesc:ac1230ff7e73783da730b8639c30511e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes the <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__sender.html" title="Implements Blob_sender concept by using an adopted Persistent_mq_handle MQ handle to an MQ (message q...">Blob_stream_mq_sender</a> and/or <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__receiver.html" title="Implements Blob_receiver concept by using an adopted Persistent_mq_handle MQ handle to an MQ (message...">Blob_stream_mq_receiver</a> persistent resources associated with a <a class="el" href="classipc_1_1transport_1_1Persistent__mq__handle.html" title="A documentation-only concept defining the behavior of an object representing a light-weight handle to...">Persistent_mq_handle</a> with the given name.  <a href="classipc_1_1transport_1_1Blob__stream__mq__base.html#ac1230ff7e73783da730b8639c30511e2">More...</a><br /></td></tr>
<tr class="separator:ac1230ff7e73783da730b8639c30511e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ef2c620fae98180ecd482f0093da44f"><td class="memTemplParams" colspan="2">template&lt;typename Handle_name_func &gt; </td></tr>
<tr class="memitem:a8ef2c620fae98180ecd482f0093da44f"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__base.html#a8ef2c620fae98180ecd482f0093da44f">for_each_persistent</a> (const Handle_name_func &amp;handle_name_func)</td></tr>
<tr class="memdesc:a8ef2c620fae98180ecd482f0093da44f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Forwards to <a class="el" href="classipc_1_1transport_1_1Persistent__mq__handle.html#ac14dd419cdbc97b6630900268f8b7dd2" title="Lists all named persistent MQs currently persisting, invoking the given handler synchronously on each...">Persistent_mq_handle::for_each_persistent()</a>.  <a href="classipc_1_1transport_1_1Blob__stream__mq__base.html#a8ef2c620fae98180ecd482f0093da44f">More...</a><br /></td></tr>
<tr class="separator:a8ef2c620fae98180ecd482f0093da44f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;typename <a class="el" href="classipc_1_1transport_1_1Persistent__mq__handle.html">Persistent_mq_handle</a>&gt;<br />
class ipc::transport::Blob_stream_mq_base&lt; Persistent_mq_handle &gt;</div><p >Base of <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__sender.html" title="Implements Blob_sender concept by using an adopted Persistent_mq_handle MQ handle to an MQ (message q...">Blob_stream_mq_sender</a> and <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__receiver.html" title="Implements Blob_receiver concept by using an adopted Persistent_mq_handle MQ handle to an MQ (message...">Blob_stream_mq_receiver</a> containing certain <code>static</code> facilities, particularly for post-abort persistent resource cleanup. </p>
<p >As of this writing this type stores no data.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname"><a class="el" href="classipc_1_1transport_1_1Persistent__mq__handle.html" title="A documentation-only concept defining the behavior of an object representing a light-weight handle to...">Persistent_mq_handle</a></td><td>See <a class="el" href="classipc_1_1transport_1_1Persistent__mq__handle.html" title="A documentation-only concept defining the behavior of an object representing a light-weight handle to...">Persistent_mq_handle</a> concept doc header. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="blob__stream__mq_8hpp_source.html#l00036">36</a> of file <a class="el" href="blob__stream__mq_8hpp_source.html">blob_stream_mq.hpp</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a8ef2c620fae98180ecd482f0093da44f" name="a8ef2c620fae98180ecd482f0093da44f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8ef2c620fae98180ecd482f0093da44f">&#9670;&nbsp;</a></span>for_each_persistent()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename <a class="el" href="classipc_1_1transport_1_1Persistent__mq__handle.html">Persistent_mq_handle</a> &gt; </div>
<div class="memtemplate">
template&lt;typename Handle_name_func &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__base.html">ipc::transport::Blob_stream_mq_base</a>&lt; <a class="el" href="classipc_1_1transport_1_1Persistent__mq__handle.html">Persistent_mq_handle</a> &gt;::for_each_persistent </td>
          <td>(</td>
          <td class="paramtype">const Handle_name_func &amp;&#160;</td>
          <td class="paramname"><em>handle_name_func</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Forwards to <a class="el" href="classipc_1_1transport_1_1Persistent__mq__handle.html#ac14dd419cdbc97b6630900268f8b7dd2" title="Lists all named persistent MQs currently persisting, invoking the given handler synchronously on each...">Persistent_mq_handle::for_each_persistent()</a>. </p>
<p >In practice this exists merely to enable templates <a class="el" href="namespaceipc_1_1util.html#ad6be904bf1b0fe6659a11dec0fabbf6b" title="Utility that invokes remove_each_persistent_if() with the filter that returns true (yes,...">remove_each_persistent_with_name_prefix()</a> and <a class="el" href="namespaceipc_1_1util.html#a150051ee7e308ba7c9269b2d1e2c6c37" title="Utility that invokes Persistent_object::for_each_persistent(name_prefix_or_empty) and synchronously i...">remove_each_persistent_if()</a> to work with <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__base.html" title="Base of Blob_stream_mq_sender and Blob_stream_mq_receiver containing certain static facilities,...">Blob_stream_mq_base</a>.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">Handle_name_func</td><td>See <a class="el" href="classipc_1_1transport_1_1Persistent__mq__handle.html#ac14dd419cdbc97b6630900268f8b7dd2" title="Lists all named persistent MQs currently persisting, invoking the given handler synchronously on each...">Persistent_mq_handle::for_each_persistent()</a>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle_name_func</td><td>See <a class="el" href="classipc_1_1transport_1_1Persistent__mq__handle.html#ac14dd419cdbc97b6630900268f8b7dd2" title="Lists all named persistent MQs currently persisting, invoking the given handler synchronously on each...">Persistent_mq_handle::for_each_persistent()</a>. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="blob__stream__mq_8hpp_source.html#l00101">101</a> of file <a class="el" href="blob__stream__mq_8hpp_source.html">blob_stream_mq.hpp</a>.</p>

<p class="reference">References <a class="el" href="blob__stream__mq__impl_8hpp_source.html#l00198">ipc::transport::Blob_stream_mq_base_impl&lt; Persistent_mq_handle &gt;::for_each_persistent()</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classipc_1_1transport_1_1Blob__stream__mq__base_a8ef2c620fae98180ecd482f0093da44f_cgraph.svg" width="348" height="59"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>

</div>
</div>
<a id="ac1230ff7e73783da730b8639c30511e2" name="ac1230ff7e73783da730b8639c30511e2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac1230ff7e73783da730b8639c30511e2">&#9670;&nbsp;</a></span>remove_persistent()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename <a class="el" href="classipc_1_1transport_1_1Persistent__mq__handle.html">Persistent_mq_handle</a> &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__base.html">ipc::transport::Blob_stream_mq_base</a>&lt; <a class="el" href="classipc_1_1transport_1_1Persistent__mq__handle.html">Persistent_mq_handle</a> &gt;::remove_persistent </td>
          <td>(</td>
          <td class="paramtype">flow::log::Logger *&#160;</td>
          <td class="paramname"><em>logger_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="namespaceipc_1_1transport.html#a33de1c256addb3964b839dc2dd407d24">Shared_name</a> &amp;&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceipc.html#aa3192e586cc45d3e7c22463bf2760f89">Error_code</a> *&#160;</td>
          <td class="paramname"><em>err_code</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Removes the <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__sender.html" title="Implements Blob_sender concept by using an adopted Persistent_mq_handle MQ handle to an MQ (message q...">Blob_stream_mq_sender</a> and/or <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__receiver.html" title="Implements Blob_receiver concept by using an adopted Persistent_mq_handle MQ handle to an MQ (message...">Blob_stream_mq_receiver</a> persistent resources associated with a <a class="el" href="classipc_1_1transport_1_1Persistent__mq__handle.html" title="A documentation-only concept defining the behavior of an object representing a light-weight handle to...">Persistent_mq_handle</a> with the given name. </p>
<p >Please see Cleanup in <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__sender.html" title="Implements Blob_sender concept by using an adopted Persistent_mq_handle MQ handle to an MQ (message q...">Blob_stream_mq_sender</a> doc header for context; and note it applies equally to <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__receiver.html" title="Implements Blob_receiver concept by using an adopted Persistent_mq_handle MQ handle to an MQ (message...">Blob_stream_mq_receiver</a>. In short: Those classes gracefully clean up by themselves, via their dtors; but an abort (or two) may prevent this from occurring &ndash; in which case one should do one of the following:</p><ul>
<li>If the name of the potentially-leaked MQ is known: Call this function, <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__base.html#ac1230ff7e73783da730b8639c30511e2" title="Removes the Blob_stream_mq_sender and/or Blob_stream_mq_receiver persistent resources associated with...">remove_persistent()</a>.</li>
<li>If not, but you used a name-prefix-based scheme: Call <code>remove_each_persistent_with_name_prefix&lt;<a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__base.html" title="Base of Blob_stream_mq_sender and Blob_stream_mq_receiver containing certain static facilities,...">Blob_stream_mq_base</a>&gt;()</code>, providing the applicable name prefix. It will invoke <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__base.html#ac1230ff7e73783da730b8639c30511e2" title="Removes the Blob_stream_mq_sender and/or Blob_stream_mq_receiver persistent resources associated with...">remove_persistent()</a> (and <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__base.html#a8ef2c620fae98180ecd482f0093da44f" title="Forwards to Persistent_mq_handle::for_each_persistent().">for_each_persistent()</a>) internally as needed.</li>
</ul>
<p >Trying to remove a non-existent name <em>is</em> an error; but typically one should ignore any error, since the function is meant for best-effort cleanup in case a leak occurred earlier due to abort(s).</p>
<p >Logs INFO message.</p>
<h3>Rationale</h3>
<p >Why does this exist, when <a class="el" href="classipc_1_1transport_1_1Persistent__mq__handle.html#a2e8b8102fdbacc064d4759533a725f51" title="Removes the named persistent MQ.">Persistent_mq_handle::remove_persistent()</a> is available? Answer: <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__base.html" title="Base of Blob_stream_mq_sender and Blob_stream_mq_receiver containing certain static facilities,...">Blob_stream_mq_base</a> sub-classes require certain internal resources (tiny SHM pools as of this writing) to ensure a single sender and single receiver per MQ (a limitation not imposed by the lower-level <a class="el" href="classipc_1_1transport_1_1Persistent__mq__handle.html" title="A documentation-only concept defining the behavior of an object representing a light-weight handle to...">Persistent_mq_handle</a> construct).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">logger_ptr</td><td>Logger to use for subsequently logging. </td></tr>
    <tr><td class="paramname">name</td><td>Absolute name at which the persistent MQ (fed to <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__sender.html" title="Implements Blob_sender concept by using an adopted Persistent_mq_handle MQ handle to an MQ (message q...">Blob_stream_mq_sender</a> and/or <a class="el" href="classipc_1_1transport_1_1Blob__stream__mq__receiver.html" title="Implements Blob_receiver concept by using an adopted Persistent_mq_handle MQ handle to an MQ (message...">Blob_stream_mq_receiver</a> ctor) lives. </td></tr>
    <tr><td class="paramname">err_code</td><td>See <code>flow::Error_code</code> docs for error reporting semantics. <a class="el" href="namespaceipc.html#aa3192e586cc45d3e7c22463bf2760f89" title="Short-hand for flow::Error_code which is very common.">Error_code</a> generated: various. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="blob__stream__mq_8hpp_source.html#l00092">92</a> of file <a class="el" href="blob__stream__mq_8hpp_source.html">blob_stream_mq.hpp</a>.</p>

<p class="reference">References <a class="el" href="blob__stream__mq__impl_8hpp_source.html#l00164">ipc::transport::Blob_stream_mq_base_impl&lt; Persistent_mq_handle &gt;::remove_persistent()</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classipc_1_1transport_1_1Blob__stream__mq__base_ac1230ff7e73783da730b8639c30511e2_cgraph.svg" width="788" height="78"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>transport/<a class="el" href="blob__stream__mq_8hpp_source.html">blob_stream_mq.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 11 2025 20:02:27 for Flow-IPC by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>
